import request from '@/utils/request'

// 查询里程列表
export function listKm(query) {
  return request({
    url: '/carowner/km/list',
    method: 'get',
    params: query
  })
}

// 查询里程详细
export function getKm(id) {
  return request({
    url: '/carowner/km/' + id,
    method: 'get'
  })
}

// 查询根据用户
export function getSum(userId) {
  return request({
    url: '/carowner/km/' + userId,
    method: 'get'
  })
}
// 新增里程
export function addKm(data) {
  return request({
    url: '/carowner/km',
    method: 'post',
    data: data
  })
}

// 修改里程
export function updateKm(data) {
  return request({
    url: '/carowner/km',
    method: 'put',
    data: data
  })
}

// 删除里程
export function delKm(id) {
  return request({
    url: '/carowner/km/' + id,
    method: 'delete'
  })
}
